import 'package:json_annotation/json_annotation.dart';

part 'generate_ai_search.g.dart';

@JsonSerializable()
class GenerateAiSearch {
  @JsonKey(defaultValue: [])
  final List<Organic> organic;

  GenerateAiSearch({
    required this.organic,
  });

  factory GenerateAiSearch.fromJson(Map<String, dynamic> json) =>
      _$GenerateAiSearchFromJson(json);

  Map<String, dynamic> toJson() => _$GenerateAiSearchToJson(this);
}

@JsonSerializable()
class Organic {
  @JsonKey(defaultValue: '')
  final String title;
  @JsonKey(defaultValue: '')
  final String link;
  @JsonKey(defaultValue: '')
  final String snippet;

  Organic({
    required this.title,
    required this.link,
    required this.snippet,
  });

  factory Organic.fromJson(Map<String, dynamic> json) =>
      _$OrganicFromJson(json);

  Map<String, dynamic> toJson() => _$OrganicToJson(this);
}
